<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "system".
 *
 * @property integer $id
 * @property string $type
 * @property string $name
 * @property string $createat
 */
class System extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'system';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'createat'], 'required'],
            [['createat','img'], 'safe'],
            [['type'], 'string', 'max' => 100],
            [['name'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'type' => Yii::t('app', '类目'),
            'name' => Yii::t('app', '名称'),
            'img' => Yii::t('app', '图片'),
            'createat' => Yii::t('app', 'Createat'),
        ];
    }

    /**
     * @inheritdoc
     * @return SystemQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new SystemQuery(get_called_class());
    }
}
